package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.pojo.vo.categoryVo.GetCategoryVo;
import com.itheima.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author tcotk
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService service;
    @GetMapping("/list")
    public R  selectAll(){
        List<GetCategoryVo> list = service.selectAll();
        return R.success(list);
    }

}
